#ifndef _V80_H_
#define _V80_H_

#include "./include/sys_type.h"

#define EM_CHAR 0x19
#define EMP_CHAR 0x99
#define DC1_CHAR 0x11
#define DC3_CHAR 0x13
#define FLAG_CHAR 0x7E

#define V80_DCE_DTE_EXT 0x60
#define V80_HDLC_FLAG_VALID   0xB1
#define V80_HDLC_FLAG_INVALID 0xB2
#define V80_CONN_RATE         0xBE


// V80 Character Definition
#define V80_SINGLE_EM   0x5C
#define V80_SINGLE_EMP  0x76
#define V80_DC1         0xA0
#define V80_DC3         0xA1
#define V80_DOUBLE_EM   0x5D
#define V80_DOUBLE_EMP  0x77
#define V80_DOUBLE_DC1  0xA2
#define V80_DOUBLE_DC3  0xA3
#define V80_EM_EMP      0xA4
#define V80_EM_DC1      0xA5
#define V80_EM_DC3      0xA6
#define V80_EMP_EM      0xA7
#define V80_EMP_DC1     0xA8
#define V80_EMP_DC3     0xA9
#define V80_DC1_EM      0xAA
#define V80_DC1_EMP     0xAB
#define V80_DC1_DC3     0xAC
#define V80_DC3_EM      0xAD
#define V80_DC3_EMP     0xAE
#define V80_DC3_DC1     0xAF

u32 V80_Encode(const char* theRawData, u32 RawDataLength, char* theV80DataBuffer);

u32 V80_Decode(const char* theV80Data, u32 V80DataLength, 
               char* theRawDataBuffer, int* theRawDataLength);


#endif
